@extends('layouts.backend')
@section('title')
前台导航&友情链接 列表
@endsection

@section('body')
<div class="row">
    <div class="ibox">
        <div class="ibox-title">
            <h5>前台导航&友情链接</h5>
        </div>
        <div class="ibox-content">
            <div class="row">
                <div class="col-md-6">
                    <form role="form" class="form-inline" method="get">
                        <div class="form-group">
                            <label for="keyword" class="sr-only">Name/Email</label>
                            <input type="text" placeholder="Enter name or email " value="{{request('keyword', '')}}" name="keyword" id="keyword" class="form-control">

                        </div>
                        <button class="btn btn-primary" type="submit">搜索</button>
                        <a href="{{ route('backend.link.index') }}" class="btn btn-warning">重置</a>
                    </form>
                </div>
                <div class="col-md-6">
                    <a href="{{route('backend.link.create')}}" class="btn btn-primary pull-right">添加</a>
                </div>
            </div>
            <table class="table">
                <thead>
                <tr>
                    <th>#</th>
                    <th>Name</th>
                    <th>Module</th>
                    <th>排序</th>
                    <th>Url</th>
                    <th>创建时间</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                @forelse($links as $link)
                <tr>
                    <td>{{$link->id}}</td>
                    <td>{{$link->name}}</td>
                    <td>
                        @if($link->module == 'nav')
                            <span class="label label-success">前台导航</span>
                        @else
                            <span class="label label-success">友情连接</span>
                        @endif
                    </td>
                    <td>{{$link->sort}}</td>
                    <td>{{$link->url}}</td>
                    <td>{{$link->created_at}}</td>
                    <td>
                        <a href="{{route('backend.link.edit', $link)}}" class="btn btn-warning btn-sm">编辑</a>
                        @include('components.backend.destroy', ['url' => route('backend.link.destroy', $link)])
                    </td>
                </tr>
                @empty
                <tr>
                    <td class="text-center" colspan="7">暂无记录</td>
                </tr>
                @endforelse
                </tbody>
            </table>
        </div>
        <div class="ibox-footer">
            {{$links->render()}}
        </div>
    </div>
</div>
@endsection
